<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:panelGrid id="messagePictureInputPanel" columns="1"
		style="width:100%">
		<p:commandButton oncomplete="pictureDlg.show()" ajax="true"
			update=":dialogForm" icon="add"
			actionListener="#{pictureController.init}" value="Add"
			title="Add pictures" style="float:left"></p:commandButton>
		<p:dataTable var="picture" value="#{messageModel.current.pictures}"
			rows="20">
			<f:facet name="header">List of pictures</f:facet>
			<p:column style="width:20px">
				<f:facet name="header">
					<p:commandButton icon="delete" ajax="true" update=":detailForm"
						style="float:right"
						actionListener="#{messageController.removeSelectedPicsFromCurrent}"></p:commandButton>
				</f:facet>
				<p:selectBooleanCheckbox value="#{picture.selected}"></p:selectBooleanCheckbox>
			</p:column>
			<p:column headerText="id" sortBy="#{picture.id}">
				<h:outputText value="#{picture.id}" />
			</p:column>
			<p:column headerText="Title" sortBy="#{picture.title}">
				<h:outputText value="#{picture.title}" />
			</p:column>
			<p:column headerText="File Name" sortBy="#{picture.fileName}">
				<h:outputText value="#{picture.fileName}" />
			</p:column>
			<p:column headerText="Uploaded Date" sortBy="#{picture.uploadedDate}">
				<h:outputText value="#{picture.uploadedDate}" />
			</p:column>
			<p:column>
				<h:graphicImage id="messageImg" library="images"
					value="../#{picture.fullFileName}" style="width:25px;height:25px"
					rendered="#{picture.isRecycled==false}"></h:graphicImage>
				<p:overlayPanel id="imgPanel" for="messageImg" showEffect="blind"
					hideEffect="explode" showEvent="mouseover" hideEvent="mouseout">
					<p:graphicImage value="../#{picture.fullFileName}" width="320" />
				</p:overlayPanel>
			</p:column>
		</p:dataTable>
	</h:panelGrid>

</ui:composition>

</html>